Optimal. Leaf size=59 \[ \frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} d (a+b)}+\frac {x}{a+b}-\frac {\tanh (c+d x)}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3670, 479, 522, 206, 205} \[ \frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} d (a+b)}+\frac {x}{a+b}-\frac {\tanh (c+d x)}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 206
Rule 479
Rule 522
Rule 3670
Rubi steps
\begin {align*} \int \frac {\tanh ^4(c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^4}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=-\frac {\tanh (c+d x)}{b d}+\frac {\operatorname {Subst}\left (\int \frac {a+(-a+b) x^2}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{b d}\\ &=-\frac {\tanh (c+d x)}{b d}+\frac {\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{(a+b) d}+\frac {a^2 \operatorname {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tanh (c+d x)\right )}{b (a+b) d}\\ &=\frac {x}{a+b}+\frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} (a+b) d}-\frac {\tanh (c+d x)}{b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.20, size = 66, normalized size = 1.12 \[ \frac {a^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2} d (a+b)}+\frac {c+d x}{d (a+b)}-\frac {\tanh (c+d x)}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.46, size = 777, normalized size = 13.17 \[ \left [\frac {2 \, b d x \cosh \left (d x + c\right )^{2} + 4 \, b d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + 2 \, b d x \sinh \left (d x + c\right )^{2} + 2 \, b d x + {\left (a \cosh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a \sinh \left (d x + c\right )^{2} + a\right )} \sqrt {-\frac {a}{b}} \log \left (\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (d x + c\right )^{2} + a^{2} - 6 \, a b + b^{2} + 4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{3} + {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + 4 \, {\left ({\left (a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a b + b^{2}\right )} \sinh \left (d x + c\right )^{2} + a b - b^{2}\right )} \sqrt {-\frac {a}{b}}}{{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (a - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b}\right ) + 4 \, a + 4 \, b}{2 \, {\left ({\left (a b + b^{2}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (a b + b^{2}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a b + b^{2}\right )} d \sinh \left (d x + c\right )^{2} + {\left (a b + b^{2}\right )} d\right )}}, \frac {b d x \cosh \left (d x + c\right )^{2} + 2 \, b d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + b d x \sinh \left (d x + c\right )^{2} + b d x + {\left (a \cosh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a \sinh \left (d x + c\right )^{2} + a\right )} \sqrt {\frac {a}{b}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )} \sqrt {\frac {a}{b}}}{2 \, a}\right ) + 2 \, a + 2 \, b}{{\left (a b + b^{2}\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (a b + b^{2}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a b + b^{2}\right )} d \sinh \left (d x + c\right )^{2} + {\left (a b + b^{2}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.23, size = 87, normalized size = 1.47 \[ \frac {\frac {a^{2} \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{{\left (a b + b^{2}\right )} \sqrt {a b}} + \frac {d x + c}{a + b} + \frac {2}{b {\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 95, normalized size = 1.61 \[ -\frac {\tanh \left (d x +c \right )}{b d}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{d \left (2 b +2 a \right )}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{d \left (2 b +2 a \right )}+\frac {a^{2} \arctan \left (\frac {\tanh \left (d x +c \right ) b}{\sqrt {a b}}\right )}{d b \left (a +b \right ) \sqrt {a b}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.60, size = 509, normalized size = 8.63 \[ -\frac {{\left (a - b\right )} \log \left ({\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (a - b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{8 \, {\left (a b + b^{2}\right )} d} + \frac {{\left (a - b\right )} \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{8 \, {\left (a b + b^{2}\right )} d} + \frac {{\left (a^{2} - 6 \, a b + b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{16 \, {\left (a b + b^{2}\right )} \sqrt {a b} d} + \frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, \sqrt {a b} b d} - \frac {{\left (a^{2} - 6 \, a b + b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{16 \, {\left (a b + b^{2}\right )} \sqrt {a b} d} - \frac {3 \, {\left (a + b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{8 \, \sqrt {a b} b d} - \frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{4 \, \sqrt {a b} b d} - \frac {\log \left ({\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} + 2 \, {\left (a - b\right )} e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{4 \, b d} + \frac {\log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{4 \, b d} + \frac {3 \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{4 \, b d} - \frac {3 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{4 \, b d} + \frac {5}{8 \, {\left (b e^{\left (2 \, d x + 2 \, c\right )} + b\right )} d} - \frac {11}{8 \, {\left (b e^{\left (-2 \, d x - 2 \, c\right )} + b\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.23, size = 56, normalized size = 0.95 \[ \frac {x}{a+b}-\frac {\mathrm {tanh}\left (c+d\,x\right )}{b\,d}+\frac {a^2\,\mathrm {atan}\left (\frac {b\,\mathrm {tanh}\left (c+d\,x\right )}{\sqrt {a\,b}}\right )}{b\,d\,\sqrt {a\,b}\,\left (a+b\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 11.28, size = 495, normalized size = 8.39 \[ \begin {cases} \tilde {\infty } x \tanh ^{2}{\relax (c )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x - \frac {\tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac {\tanh {\left (c + d x \right )}}{d}}{a} & \text {for}\: b = 0 \\\frac {x - \frac {\tanh {\left (c + d x \right )}}{d}}{b} & \text {for}\: a = 0 \\\frac {3 d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {3 d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 \tanh ^{3}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {3 \tanh {\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {x \tanh ^{4}{\relax (c )}}{a + b \tanh ^{2}{\relax (c )}} & \text {for}\: d = 0 \\- \frac {2 i a^{\frac {3}{2}} b \sqrt {\frac {1}{b}} \tanh {\left (c + d x \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} + \frac {2 i \sqrt {a} b^{2} d x \sqrt {\frac {1}{b}}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} - \frac {2 i \sqrt {a} b^{2} \sqrt {\frac {1}{b}} \tanh {\left (c + d x \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} + \frac {a^{2} \log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} - \frac {a^{2} \log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 i a^{\frac {3}{2}} b^{2} d \sqrt {\frac {1}{b}} + 2 i \sqrt {a} b^{3} d \sqrt {\frac {1}{b}}} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________